The delegates, Data types


Description:

Delegates are functions contained by an object (by object you should understand an instantiated class) that are referenced by a variable. Delegates cannot be static functions. A delegate should respect the rights of the calling point (so, if is private, the caller must be able to call the delegate). Delegates can be passed as parameters to functions providing callback.

Example
class Main {
	function mydelegate(x) {
		echo x; // prints x
	}

	function Main() {
		var f=mydelegate;
		// now e can call the delegate function this way:
		f();
	}
}